package com.itheima.mapper;

import com.itheima.pojo.OrderSetting;
import org.apache.ibatis.annotations.*;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface OrderSettingMapper {
    @Update("update t_ordersetting set number = #{number} where orderDate = #{orderDate}")
    int editNumberByOrderDate(OrderSetting orderSetting);
@Select("select * from t_ordersetting where orderDate between #{startDay} and #{endDay}")
    List<OrderSetting> getOrderSettingByMonth(LocalDate startDay, LocalDate endDay);


@Select("select count(*) from t_ordersetting where orderDate = #{orderDate}")
    int countByOrderDate(LocalDate orderDate);
@Update("update t_ordersetting set number = #{number} where orderDate = #{orderDate}")
    void updateNumberByOrderDate(OrderSetting os);
@Insert("insert into t_ordersetting values(null,#{orderDate},#{number},0)")
    void insert(OrderSetting os);
}
